<template>
    <div v-if="ishead">
        <template v-if="itemdata.lCanInput === '0'">
            <van-field size="large" :id="itemdata.sField" disabled v-model="itemdata.value" :label="itemdata.sTitle" :error-message="itemdata.errormsg" />
        </template>
        <template v-else>
            <van-field size="large" :id="itemdata.sField" placeholder="请输入" clearable v-model="itemdata.value" :label="itemdata.sTitle" :error-message="itemdata.errormsg" />
        </template>
    </div>
    <div v-else>
        <template v-if="itemdata.lCanInput === '0'">
            <van-field size="large" :id="index + '_' + itemdata.sField" disabled v-model="itemdata.value" :label="itemdata.sTitle" :error-message="itemdata.errormsg" />
        </template>
        <template v-else>
            <van-field size="large" placeholder="请输入" :id="index + '_' + itemdata.sField" clearable v-model="itemdata.value" :label="itemdata.sTitle" :error-message="itemdata.errormsg" />
        </template>
    </div>
</template>
<script>
export default {
  props: {
    itemdata: {
      type: Object,
      required: false
    },
    ishead: {
      type: Boolean,
      default: false
    },
    index: {
      type: Number,
      required: false
    }
  }
}
</script>
